package com.heiyanqiang.controller;

import com.heiyanqiang.domain.SysLog;
import com.heiyanqiang.service.LogAopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping("/sysLog")
public class LogController {
    //findAll.do
    @Autowired
    private LogAopService logAopService;

    @RequestMapping("/findAll.do")
    public ModelAndView findAll(){
        ModelAndView mv = new ModelAndView();
        List<SysLog> list = logAopService.findAll();
        mv.addObject("sysLogs",list);
        mv.setViewName("syslog-list");

        return mv;
    }

}
